<template>
  <div>
    <div v-if="postList.length > 0">
      <a-list item-layout="horizontal" :data-source="postList">
        <template #renderItem="{ item }">
          <a-list-item>
            <a-list-item-meta
              :description="item.content"
            >
              <template #title>
                <a class="article-title" href="https://www.antdv.com/">{{ item.title }}</a>
              </template>
              <template #avatar>
                <!-- <a-avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" /> -->
              </template>
            </a-list-item-meta>
          </a-list-item>
        </template>
      </a-list>
    </div>
    <div v-else>
      <a-empty />
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';

const props = defineProps({
  postList: {
    type: Array,
    required: true,
  }
})

</script>

<style scoped>
.article-title {
    overflow: hidden;
    color: rgba(0, 0, 0, 0.85);
    font-weight: bold;
    font-size: 16px;
    line-height: 1.5715;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 10px 0;
}
</style>
